import { rolelist } from '../../../request/api'
const state = {
    roleList: [],//角色数据列表
}

const mutations = {
    GETROLELIST(state, payload) {
        state.roleList = payload;
    }
}

const actions = {
    //获取角色列表
    getRoleListActions({commit}) {
        rolelist().then(res => {
            commit('GETROLELIST',res.list)

        })
    }
}

const getters = {
    getRoleList(state) {
        return state.roleList;
    }
}

export default {
    state, mutations, actions, getters, namespaced: true
}